package com.ts.test;

import com.gitee.apanlh.util.algorithm.digest.MD5;
import com.gitee.apanlh.util.base.StringUtils;
import com.gitee.apanlh.util.log.Dev;

/**
 * @author Pan
 */
public class SignDemo {

    public static String all(String fullParam) {
        return MD5.create().digestToHex(fullParam);
    }

    public static String param(String param, String id, String time) {
        return MD5.create().digestToHex(StringUtils.append(param, id, time));
    }

    public static void main(String[] args) {
        String fullParam = "{\"age\":1,\"bankCard\":\"\",\"bizLicenseYear\":\"1\",\"btLimit\":\"1\",\"carInfo\":\"2\",\"career\":1,\"city\":\"临沧市\",\"creditLimit\":2,\"hbLimit\":\"1\",\"idcard\":\"\",\"insurancePolicy\":4,\"ip\":\"116.162.0.186\",\"loanAmount\":\"1\",\"monthlySalary\":\"2\",\"phoneMd5\":\"411457254209eeed384f695920e253a6\",\"providentFund\":\"2\",\"realEstateInfo\":\"6\",\"salaryPayMethod\":\"2\",\"sesameCredit\":4,\"socialSecurity\":\"2\",\"userName\":\"测试张\"}18248633685617090561715772235222";
        Dev.log(all(fullParam));

        String param = "{\"city\":\"绍兴市\",\"phoneMd5\":\"32bb598ec8c295e42858dee36e496f4e\"}";
        String id = "1842269880900800512";
        String time = "1719972842639";
        Dev.log(param(param, id, time));
    }
}
